<template>
	<view style="min-height: 100vh;background-color: #F5F7FA;">
		<hx-navbar ref="hxnb" :config="config" />
		<view :class="'ckp ' + (show ? 'showon':'showdown')" style="background-image: url('/static/ckp.png');"
			ref="ckp" />
		<view :class="'context ' + (show ? 'showon':'showdown')" style="background-image: url('/static/dgpj.png');"
			ref="context">
			<div class="line-a">
				<div class="title">增值税专用发票</div>
			</div>
			<div class="line-b">
				<div class="box">
					<div class="box1">购买方名称</div>
					<div class="box2">成都惠旗连锁有限公司</div>
				</div>
				<div class="box">
					<div class="box1">销售方名称</div>
					<div class="box2">成都达达食品有限公司</div>
				</div>
				<div class="box">
					<div class="box1">价税合计</div>
					<div class="box2">￥174000.00</div>
				</div>
				<div class="box">
					<div class="box1">开票日期</div>
					<div class="box2">2018-07-20</div>
				</div>
			</div>
			<div class="line-d">
				<div class="box">
					<div class="box1">金额</div>
					<div class="box2">￥150000.00</div>
				</div>
				<div class="box">
					<div class="box1">税额</div>
					<div class="box2">￥24000.00</div>
				</div>
				<div class="box">
					<div class="box1">发票代码</div>
					<div class="box2">5106532891</div>
				</div>
				<div class="box">
					<div class="box1">发票号码</div>
					<div class="box2">52671800</div>
				</div>
				<div class="box">
					<div class="box1">校验码</div>
					<div class="box2">-</div>
				</div>
			</div>
			<div class="line-e">
				<div class="box">
					<div class="box1">购买方纳税人识别号</div>
					<div class="box2">91510101473M85682</div>
				</div>
				<div class="box">
					<div class="box1">购买方地址/电话</div>
					<div class="box2" style="width: 164px;">成都市锦江区大业路78号028-86113977</div>
				</div>
				<div class="box">
					<div class="box1">开户行及账号</div>
					<div class="box2" style="width: 164px;">中国工商银行股份有限公司芷泉支行4442528591778654000</div>
				</div>
			</div>
			<div class="line-f">
				<div class="box">
					<div class="box1">销售方纳税人识别号</div>
					<div class="box2">9151010378816054D</div>
				</div>
				<div class="box">
					<div class="box1">销售方地址/电话</div>
					<div class="box2" style="width: 164px;">成都市青羊区苏坡北路16号028-87317574</div>
				</div>
				<div class="box">
					<div class="box1">开户行及账号</div>
					<div class="box2" style="width: 164px;">中国工商银行股份有限公司苏坡支行4442589351022013654</div>
				</div>
			</div>
			<div class="line-g">
				<div class="box">
					<div class="box1">备注</div>
					<div class="box2">-</div>
				</div>
				<div class="box">
					<div class="box1">是否有公司钢印</div>
					<div class="box2">否</div>
				</div>
				<div class="box">
					<div class="box1">第几联</div>
					<div class="box2">第一联</div>
				</div>
				<div class="box">
					<div class="box1">发票联次</div>
					<div class="box2">记账联</div>
				</div>
				<div class="box">
					<div class="box1">密码区</div>
					<div class="box2">-</div>
				</div>
			</div>
			<div class="line-c">
				<button plain="true" class="button"></button>
			</div>
		</view>
		<view class="sub-area">
			<view class="form">
				<uni-list>
					<uni-list-item title="进项税额" rightText="￥1.2" style="height: 64px;"></uni-list-item>
					<uni-list-item title="查看票据" showArrow style="height: 63.5px;"></uni-list-item>
					<uni-list-item title="转交给其他同事" showArrow style="height: 63.5px;"></uni-list-item>
				</uni-list>
			</view>
		</view>
		<view class="button-bottom-bar">
			<custom-double-button :save="save" :edit="edit"></custom-double-button>
		</view>

	</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				config: {
					title: '增值税专用发票',
					color: '#FFFFFF',
					//背景颜色;参数一：透明度（0-1）;参数二：背景颜色（array则为线性渐变，string为单色背景）
					backgroundColor: [1, ['#0052D9', '#0060FF']],
					// 滑动屏幕后切换颜色，注意颜色为数组时长度必须一样，还有使用滑动切换必须监听 onPageScroll 事件
					slideBackgroundColor: [0.2, ['#0052D9', '#0060FF']],
					// 状态栏 ，数组则为滑动变色
					statusBarBackground: ['', '#ffffff'],
					backgroundImg: ['/static/bj.png', '/static/bj.png', 1, 0],
					backgroundImgHeight: 138,
					backgroundColorLinearDeg: '229deg'
				},
				show: true,
			}
		},
		onPageScroll(e) {
			// 重点，用到滑动切换必须加上
			this.$refs.hxnb.pageScroll(e);
			if (e.scrollTop > uni.getSystemInfoSync().statusBarHeight + 44) {
				this.show = false;
			} else {
				this.show = true;
			}
		},
		methods: {
			edit() {
				uni.navigateTo({
					url: '/pages/index/index'
				})
			},
			save() {
				uni.navigateTo({
					url: '/pages/index/index'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.ckp {
		width: 100%;
		height: 16px;
		background: #BFD7FF;
		box-shadow: 0 0 8px 0 rgba(13, 49, 116, 0.10);
		border-radius: 4px;
		background-size: 100% 100%;
		/* 背景图片被拉伸,覆盖整个元素 */
		margin-bottom: -8px;
		position: relative;
	}

	.showon {
		z-index: 100;
	}

	.showdown {
		z-index: 0;
	}

	.context {
		width: auto;
		/* 原来是100%1111 */
		height: 1200px;
		/* background: #F2F9FE; */
		background-size: 100% 100%;
		/* 背景图片被拉伸,覆盖整个元素 */
		box-shadow: 0 0 8px 0 rgba(13, 49, 116, 0.10);
		margin-left: 12px;
		margin-right: 12px;
		border-bottom-left-radius: 8px;
		border-bottom-right-radius: 8px;
		position: relative;
	}

	.context .line-a {
		width: auto;
		height: 93.5px;
		background: url("/static/dc.png") no-repeat center;
		background-size: 100px 62px;
		display: flex;
		justify-content: center;
		align-items: center;
		/* margin-top: 16px;
		background-size: cover; */
	}

	.context .line-a .title {
		/* width: 100%; */
		/* 一直不居中,删掉后就好了 */
		height: 16px;
		font-family: PingFangSC-Regular;
		font-weight: 400;
		font-size: 16px;
		color: #9E3828;
		letter-spacing: 0;
		line-height: 16px;
	}

	.context .line-b {
		height: 184px;
	}

	.context .line-b .box {
		height: 42px;
	}

	.context .line-b .box .box1 {
		float: left;
		margin-left: 16px;
		margin-top: 12px;
		font-family: PingFangSC-Regular;
		font-weight: 400;
		font-size: 16px;
		color: #122453;
		letter-spacing: 0;

	}

	.context .line-b .box .box2 {
		float: right;
		margin-top: 12px;
		margin-right: 16px;
		font-family: PingFangSC-Regular;
		font-weight: 400;
		font-size: 16px;
		color: #122453;
		letter-spacing: 0;
		text-align: right;
	}

	.context .line-d {
		height: 224px;

	}

	.context .line-d .box {
		height: 44.8px;
	}

	.context .line-d .box .box1 {
		float: left;
		margin-left: 16px;
		margin-top: 12px;
		font-family: PingFangSC-Regular;
		font-weight: 400;
		font-size: 16px;
		color: #122453;
		letter-spacing: 0;

	}

	.context .line-d .box .box2 {
		float: right;
		margin-top: 12px;
		margin-right: 16px;
		font-family: PingFangSC-Regular;
		font-weight: 400;
		font-size: 16px;
		color: #122453;
		letter-spacing: 0;
		text-align: right;
	}

	.context .line-e {
		height: 217px;

	}

	.context .line-e .box {
		height: 66px;
	}

	.context .line-e .box .box1 {
		float: left;
		margin-left: 16px;
		margin-top: 12px;
		font-family: PingFangSC-Regular;
		font-weight: 400;
		font-size: 16px;
		color: #122453;
		letter-spacing: 0;

	}

	.context .line-e .box .box2 {
		float: right;
		margin-top: 12px;
		margin-right: 16px;
		font-family: PingFangSC-Regular;
		font-weight: 400;
		font-size: 16px;
		color: #122453;
		letter-spacing: 0;
		text-align: right;
	}

	.context .line-f {
		height: 217px;
		margin-bottom: 10px;
	}

	.context .line-f .box {
		height: 66px;
	}

	.context .line-f .box .box1 {
		float: left;
		margin-left: 16px;
		margin-top: 12px;
		font-family: PingFangSC-Regular;
		font-weight: 400;
		font-size: 16px;
		color: #122453;
		letter-spacing: 0;

	}

	.context .line-f .box .box2 {
		float: right;
		margin-top: 12px;
		margin-right: 16px;
		font-family: PingFangSC-Regular;
		font-weight: 400;
		font-size: 16px;
		color: #122453;
		letter-spacing: 0;
		text-align: right;
	}

	.context .line-g {
		height: 224px;
	}

	.context .line-g .box {
		height: 44px;
	}

	.context .line-g .box .box1 {
		float: left;
		margin-left: 16px;
		margin-top: 12px;
		font-family: PingFangSC-Regular;
		font-weight: 400;
		font-size: 16px;
		color: #122453;
		letter-spacing: 0;

	}

	.context .line-g .box .box2 {
		float: right;
		margin-top: 12px;
		margin-right: 16px;
		font-family: PingFangSC-Regular;
		font-weight: 400;
		font-size: 16px;
		color: #122453;
		letter-spacing: 0;
		text-align: right;
	}

	.context .line-c {
		width: 100%;
		height: 39.5px;

	}

	.context .line-c .button {
		width: 24px;
		height: 24px;
		background-image: url('/static/sq.png');
		border: 0;
	}


	.sub-area {
		padding-bottom: 60px;

		.form {
			width: auto;
			height: 192px;
			background: #FFFFFF;
			box-shadow: 0 0 8px 0 rgba(13, 49, 116, 0.10);
			/* 正常定位距离 */
			margin-top: 18px;
			margin-left: 12px;
			margin-right: 12px;
			border-radius: 8px;
		}
	}


	.button-bottom-bar {
		position: fixed;
		bottom: 16px;
		width: 100%;
	}
</style>
